<?
include 'config/config.inc.php';
$error = '&nbsp;';
session_start();
if($_GET['op']!="") {
	logout();	
}
if($_SESSION['idutente']!="") {
	header("Location:admin.php");
	die();
}
if($_POST['username']!="" && $_POST['pw']!="") {
	$error = login($_POST['username'], $_POST['pw']);
		if($error=="") {
		  header("Location:admin.php");
		  die();
		} else {
			$error = '<p class="error">'.$error.'</p>';
		}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="stili/stili.css" rel="stylesheet" type="text/css" />
<title>Check Flayer Module</title>
</head>
<body>
<div class="container">
<div class="login">
<div class="header">Login</div>
<div class="content">
<p>Inserisci i tuoi dati per l'accesso</p>
<form action="index.php" method="POST">
<p>&nbsp;</p>
<p><b>Username:</b> <input class="size150" type="text" id="username" name="username" /></p>
<p>&nbsp;</p>
<p><b>Password:</b> <input class="size150" type="password" id="pw" name="pw" /></p>
<p><?=$error?></p>
<p align="center"><input type="submit" value="LOGIN" /></p>
</form>
</div>
</div>
</div>
</body>
</html>